//
//  SelectImproveCell.swift
//  KaMengApplication
//
//  Created by DUONIU_MAC on 2018/10/18.
//  Copyright © 2018年 DUONIU_MAC. All rights reserved.
//

import UIKit

class SelectImproveCell: UITableViewCell {
    
    fileprivate let titleLabel = UILabel()
    let bankImageView = UIImageView()
    
    //银行标题
    var bankText : String! {
        didSet{
            titleLabel.text = bankText
        }
    }
    
    //银行图片
    var imageUrl : String! {
        didSet{
            bankImageView.setUrlImage(with: imageUrl, placeholder: UIImage.imageWithName("loading"))
        }
    }

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        titleLabel.font = UIFont.systemFont(ofSize: RATIO(maxNum: 16))
        self.contentView.addSubview(titleLabel)
        
        self.contentView.addSubview(bankImageView)
        
        titleLabel.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.centerX.equalToSuperview().offset(RATIO(maxNum: 20))
            make.width.greaterThanOrEqualTo(10)
            make.height.greaterThanOrEqualTo(10)
        }
        
        bankImageView.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.right.equalTo(titleLabel.snp.left).offset(RATIO(maxNum: -10))
            make.width.height.equalTo(RATIO_H(maxNum: 25))
        }
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

    }

}
